1. Field of the Invention
The present invention relates to an apparatus and method for controlling memory rewriting operation, and more particularly to an apparatus and method which has a function of holding an electric power supply during rewriting of programs and data stored in a rewritable nonvolatile memory.
2. Description of Related Art
A conventional electronic control unit for controlling a predetermined control object such as an internal combustion engine has a function of holding an electric power supply during a rewriting of a program stored in a rewritable nonvolatile memory. This apparatus is so constructed that a main relay is controlled to hold the electric power supply, thereby preventing a failure of program rewriting due to an accidental interruption of the electric power supply when rewriting data are transmitted from a memory rewriting device connected externally and the program stored in the rewritable nonvolatile memory is rewritten.
When the communication with the memory rewriting device fails or a rewriting processing program in the electronic control unit fails to run normally, the program rewriting is interrupted and the rewriting operation need to be started again from the beginning. If the electronic control unit continues to hold the main relay turned on in this instance, the electric power supply is not stopped and the rewriting processing can not be stopped forcibly even when an ignition switch is turned off.
It is proposed to avoid this problem that the main relay is turned off by the ignition switch when needed. It is however disadvantageous that, when the ignition switch is turned off accidentally during a rewriting of a boot program for initiating the rewriting processing program, the boot program is destroyed disabling the program rewriting again.